home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include "lpc.h"
-
- /*#define ENCODE/**/
- /*#define DECODE/**/
-
- main(argc, argv)
- int argc;
- char **argv;
- {
- int nbytes;
- unsigned char buf[160];
- lpcparams_t params;
-
- lpcstate_t state;
-
- fprintf(stderr, "S = %d\n", sizeof params);
- lpc_init(&state);
- #ifndef DECODE
- while ((nbytes = read(0, buf, sizeof(buf))) > 0) {
- lpc_analyze(buf, ¶ms);
- #else
- while ((nbytes = read(0, ¶ms, sizeof(params))) > 0) {
- #endif
- #ifdef ENCODE
- write(1, ¶ms, sizeof params);
- #else
- lpc_synthesize(buf, ¶ms, &state);
- write(1, buf, nbytes);
- #endif
- }
- }
-